
<div class="content-box">
    <div class="box-header clear">
        <ul class="tabs clear">
            <li ><a href='<?php echo base_url(); ?>product/add' class="selected"><?php echo lang('btn_add') ?></a></li>
        </ul>
        <h2><?php echo lang('pg_product') ?></h2>
    </div>
    <div class="box-body clear">
        <div id="data-table">
            <?php echo form_open(base_url() . 'product/search'); ?>
            <div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_product_name') ?> :</label>
                <input type="input" value="<?php echo set_value('product_name'); ?>" name="product_name" id="product_name" class="text" />
            </div>
            <div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_category_name') ?> :</label>
                <select name="category_id">
                	<option value=""><?php echo lang('lbl_select_category');?></option>
                	<?php foreach($categorys as $item){
                		echo '<option value="'.$item->id.'" '.($item->id == $category_id ? "selected='selected'": "").'>'.$item->category_name.'</option>';
                	}?>
                </select>
            </div>
            <div class="form-field clear">
                <label class="form-label fl-space2"><?php echo lang('lbl_provider_name') ?> :</label>
                <select name="provider_id">
                	<option value=""><?php echo lang('lbl_select_provider');?></option>
                	<?php foreach($providers as $item){
                		echo '<option value="'.$item->id.'" '.($item->id == $provider_id ? "selected='selected'": "").'>'.$item->provider_name.'</option>';
                	}?>
                </select>
                <input type="submit" value="<?php echo lang('btn_search');?>" />
            </div>
            <table class="datatable">
                <thead>
                    <tr>
                        <th><?php echo lang('lbl_product_name') ?></th>
                        <th><?php echo lang('lbl_status') ?></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    foreach ($products as $key => $item):
                        ?>
                        <tr id="row<?php echo $key; ?>">
                            <td><?php echo $item->product_name; ?></td>
                            <td><?php echo $status[$item->status]; ?></td>
                            <td>
                                <a href="<?php echo base_url(); ?>product/edit/<?php echo $item->id; ?>">
                                    <img title="<?php echo lang('btn_edit') ?>" alt="" class="icon16 fl-space2" src="<?php echo base_url() . SKINSPATH; ?>admin/images/ico_edit_16.png">
                                </a>
                                <a href="javascript:remove('row<?php echo $key; ?>','<?php echo base_url(); ?>product/delete','<?php echo $item->id; ?>')">
                                    <img title="<?php echo lang('btn_delete') ?>" alt="" class="icon16 fl-space2" src="<?php echo base_url() . SKINSPATH; ?>admin/images/ico_delete_16.png">
                                </a>
                            </td>
                        </tr>

                    <?php endforeach; ?>
                </tbody>
            </table>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>